import { createSlice } from "@reduxjs/toolkit";

type city = {
    id: number,
    nm: string,
    py: string,
};
type cinemaCity = {
    hot: string[],
    cts: city[];
};

export const movieData = createSlice({
    name: 'movieData',
    initialState: {
        userCityCinema: "",
        cinemaCity: null,
        title: "",
        rating: 0,
        data: null,
    },
    reducers: {
        setUserCityCinema(state, action) {
            state.userCityCinema = action.payload;
        },
        setCinemaCity(state, action) {
            state.cinemaCity = action.payload;
        }
    }
});

export const { setUserCityCinema, setCinemaCity } = movieData.actions;

export default movieData.reducer;